package com.magicmovie.mapper;

import com.github.pagehelper.Page;
import com.magicmovie.entity.Movie;
import com.magicmovie.utils.QueryFilters;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Map;

@Mapper
public interface MovieMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Movie record);

    int insertSelective(Movie record);

    Movie selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Movie record);

    int updateByPrimaryKey(Movie record);

    List<Map<String,Object>> findByIndexCategory(Integer indexCategoryId);

    Map<String,Object> findById(Integer id);

    Page<Map<String,Object>> findPurchasedMovie(Integer customerId);

    Page<Map<String,Object>> findByParams(Map<String, Object> params);

    Page<Map<String,Object>> findByHotSale();

    List<Map<String,Object>> queryByParams(Map<String, Object> map);

    Integer queryCount(Map<String, Object> map);

    Page<Map<String, Object>> getByFilter(QueryFilters filters);
}